import { createRouter, createWebHistory } from 'vue-router'

let routes = [
    {
        path: '/',
        name: 'home',
        component: () => import('../views/Home.vue'),
        //show 表示要不要在菜单中展示
        //useFrame 表示是否为大屏 大屏为true，否则为false
        meta: { title: '首页', icon:'House',show:true, useFrame:false}
    },
    {
        path: '/movehome',
        name: 'movehome',
        component: () => import('../views/movecat/Movehome.vue'),
        meta: { title: '移动首页', icon:'Cellphone',show:true, useFrame:true}
    },
    {
        path: '/downApp',
        name: 'downApp',
        component: () => import('../views/movecat/DownApp.vue'),
        meta: { title: '下载app', icon: 'Cellphone', show: false, useFrame: true }
    },
    {
        path: '/searchs',
        name: 'searchs',
        component: () => import('../views/movecat/Searchs.vue'),
        meta: { title: '搜索框', icon: 'Cellphone', show: false, useFrame: true }
    },
    {
        path: '/moveDeial',
        name: 'moveDeial',
        component: () => import('../views/movecat/MoveDeial.vue'),
        meta: { title: '视频详情页', icon: 'Cellphone', show: false, useFrame: true }
    },
    {
        path: '/product',
        name: 'product',
        component: () => import('../views/Product/Index.vue'),
        meta: { title: '商品管理', icon: 'CoffeeCup', show: true, useFrame: false },
        children: [
            {
                path: '/product/list',
                name: 'productList',
                component: () => import('../views/Product/LIst.vue'),
                meta: { title: '商品列表', icon: 'List', show: true, },
            },
            {
                path: '/product/add',
                name: 'productAdd',
                component: () => import('../views/Product/Add.vue'),
                meta: { title: '商品添加', icon: 'Plus', show: true, },
            },
            {
                path: '/product/edit',
                name: 'productEdit',
                component: () => import('../views/Product/Edit.vue'),
                meta: { title: '商品修改', icon: 'Edit', show: true, },
            }
        ]
    },
    {
        path: '/category',
        name: 'category',
        component: () => import('../views/category/Index.vue'),
        meta: { title: '类目管理', icon: 'Grid', show: true, useFrame: false },
        children: [
            {
                path: '/category/list',
                name: 'categoryList',
                component: () => import('../views/category/LIst.vue'),
                meta: { title: '类目列表', icon: 'List', show: true, },
            },
            {
                path: '/category/add',
                name: 'categoryAdd',
                component: () => import('../views/category/Add.vue'),
                meta: { title: '类目添加', icon: 'Plus', show: true, },
            },
            {
                path: '/category/edit',
                name: 'categoryEdit',
                component: () => import('../views/category/Edit.vue'),
                meta: { title: '类目修改', icon: 'Edit', show: true, },
            }
        ]
    }
]

const router = createRouter({
    history: createWebHistory(),
    routes
})

//导出
export default router